package it.avantsoft.ls.peer.message;

import java.io.DataOutputStream;
import java.io.IOException;

public class NewSonABMessage extends PeerMessage {

    private String id;

    public NewSonABMessage(DataOutputStream out, String id) {
        super(out);
        this.id = id;
    }

    public boolean send() {
        boolean sent = false;
        try {
            writeByte(NEWSON);
            writeUTF(id);//id del nuovo figlio
            flush();
            sent = true;
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }

        return sent;
    }
}
